package com.tledu.carLog.service.impl;

import com.tledu.carLog.domain.CarLog;
import com.tledu.carLog.domain.dto.CarLogDto;
import com.tledu.carLog.mapper.CarLogMapper;
import com.tledu.carLog.service.ICarLogService;
import com.tledu.carUse.domain.CarUse;
import com.tledu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 操作日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-02
 */
@Service
public class CarLogServiceImpl implements ICarLogService 
{
    @Autowired
    private CarLogMapper carLogMapper;

    /**
     * 查询操作日志
     * 
     * @param id 操作日志主键
     * @return 操作日志
     */
    @Override
    public CarUse selectCarLogById(Long id)
    {
        return carLogMapper.selectCarLogById(id);
    }

    @Override
    public CarUse selectCarLogById1(Long id) {
        return carLogMapper.selectCarLogById1(id);
    }

    /**
     * 查询操作日志列表
     * 
     * @param carLog 操作日志
     * @return 操作日志
     */
    @Override
    public List<CarLogDto> selectCarLogList(CarLogDto carLogDto)
    {
        return carLogMapper.selectCarLogList(carLogDto);
    }

    /**
     * 新增操作日志
     * 
     * @param carLog 操作日志
     * @return 结果
     */
    @Override
    public int insertCarLog(CarLog carLog)
    {
        carLog.setCreateTime(DateUtils.getNowDate());
        return carLogMapper.insertCarLog(carLog);
    }

    /**
     * 修改操作日志
     * 
     * @param carLog 操作日志
     * @return 结果
     */
    @Override
    public int updateCarLog(CarLog carLog)
    {
        return carLogMapper.updateCarLog(carLog);
    }

    /**
     * 批量删除操作日志
     * 
     * @param ids 需要删除的操作日志主键
     * @return 结果
     */
    @Override
    public int deleteCarLogByIds(Long[] ids)
    {
        return carLogMapper.deleteCarLogByIds(ids);
    }

    /**
     * 删除操作日志信息
     * 
     * @param id 操作日志主键
     * @return 结果
     */
    @Override
    public int deleteCarLogById(Long id)
    {
        return carLogMapper.deleteCarLogById(id);
    }
}
